package com.gree.scmservice.config;

import com.threadnew.tnmq.factory.MQFactory;
import com.threadnew.tnmq.producer.RocketMQProducer;
import org.apache.rocketmq.client.exception.MQClientException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author shqiwei
 */
@Configuration
public class EmailProducerConfiguration {

    /**
     * 邮件消息生产者
     */
    @Bean(name = "scmEmailProducerApply", initMethod = "start", destroyMethod = "shutdown")
    public RocketMQProducer createScmEmailProducer() throws MQClientException {
        RocketMQProducer producer = MQFactory.createProducer("10.2.30.75:9000", "RC_SCM_EMAIL_PGROUP", "RC_SCM_EMAIL_TOPIC");
        return producer;
    }

}
